﻿using System;
using System.Web.Mvc;
using AutoMapper;
using WebApp.ModelService;
using WebApp.Services;

namespace WebApp.Controllers
{
    public class ContactController : SmartController
    {
        private readonly IContactModelService _contactModelService;
        public ContactController(IUserSession userSession, IMappingEngine mappingEngine, IContactModelService contactModelService)
            : base(userSession, mappingEngine)
        {
            _contactModelService = contactModelService;
        }

        public ActionResult Index()
        {
            var response = _contactModelService.GetPageBySpecification();
            return View(response);
        }

        public ActionResult Add()
        {
            var response = _contactModelService.GetContactDetailById();
            return View(response);
        }

        public ActionResult Show(Guid id)
        {
            var response = _contactModelService.GetContactDetailById(id);
            return View(response);
        }

        public ActionResult Edit(Guid id)
        {
            var response = _contactModelService.GetContactDetailById(id);
            return View(response);
        }
    }
}
